package day11;

import java.util.ArrayList;
import java.util.Map;
import java.util.stream.Collectors;

public class test03 {
    public static void main(String[] args) {
        ArrayList<String> list = new ArrayList<>();
        list.add("lihua,23");
        list.add("liuhua,25");
        list.add("sihua,24");

        Map<String, Integer> collect = list.stream().filter(
                s -> {
                    String[] split = s.split(",");
                    int age = Integer.parseInt(split[1]);
                    return age >= 24;
                }).collect(Collectors.toMap(
                key ->
                        key.split(",")[0]
                ,
                value ->
                        Integer.parseInt(value.split(",")[1])

        ));
        System.out.println(collect);

    }
}
